import os
import sys
import xml.etree.ElementTree as ET

truePath = "/home/letitia/py-R-FCN/data/VOCdevkit0712/VOC0712_shelf/Annotations"
testPath = "/home/letitia/py-R-FCN/data/VOCdevkit0712/VOC0712_shelf/xmlfile"


for path,subdir,dirnames in os.walk(testPath):
	for name in dirnames:
		#print name
		label_objects = []
		label = ET.parse(truePath + "/" + name)
		root = label.getroot()
		root_child = root.getchildren()
		for ob in root_child:
			if ob.tag == "object":
				child = ob.getchildren()
				print child[2]
				#label_objects.append(ob)

		test_objects = []
		testlabel = ET.parse(testPath + "/" + name)
		testroot = testlabel.getroot()
		testroot_child = testroot.getchildren()
		for ob in testroot_child:
			if ob.tag == "object":
				child = ob.getchildren()
				#label_objects.append(ob)sss
    	for label_object in label_objects:
			for test_object in test_objects:
				for i in range(0,4):
					if label_object[i]==test_object[i] :
						print "!!!"



